package cn.rongdao.jrkabao.ui.cashadvance.uicomponent;

import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.mifengkong.frtools.util.FRString;

import cn.rongdao.jrkabao.R;

/**
 * Created by jack on 2017/9/13
 */

public class CashAdvanceSuccessFooterUIComponent extends LinearLayout {
    public CashAdvanceSuccessFooterUIComponent(Context context) {
        super(context);
    }

    public CashAdvanceSuccessFooterUIComponent(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public CashAdvanceSuccessFooterUIComponent(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    private TextView tvGoMain;
    private PaymentDateUIComponent paymentDateUIComponent;

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        tvGoMain = (TextView) findViewById(R.id.lcsf_tv_go_main);
        paymentDateUIComponent = (PaymentDateUIComponent) findViewById(R.id.lcsf_payment_date);
    }

    public void setGoMainContent(String content) {
        tvGoMain.setText(FRString.valueOf(content));
    }

    public void setPaymentDate(String name, String time, String tip) {
        paymentDateUIComponent.setVisibility(View.VISIBLE);
        paymentDateUIComponent.setContent(name, time, tip);
    }

    public void setOnGoMainClickListener(OnClickListener clickListener) {
        tvGoMain.setOnClickListener(clickListener);
    }
}
